#include <QDebug>
#include <time.h>
#include <QTime>
#include <QPluginLoader>

#include "unionhmidll_global.h"
#include "WorkThreadManage/hmithreadmanage.h"
#include "ui_mainwindow.h"

short HmiThread :: SignalSlotConnect(){
    connect(ui->Switch, SIGNAL(clicked()), this, SLOT(onbtnclicked_Switch_Clicked()));

    connect(ui->vPower, SIGNAL(clicked()), this, SLOT(onbtnclicked_vPower()));
    connect(ui->ESTOP, SIGNAL(clicked()), this, SLOT(onbtnclicked_ESTOP()));
    connect(ui->Home, SIGNAL(clicked()), this, SLOT(onbtnclicked_Home()));

    connect(ui->Setting, SIGNAL(clicked()), this, SLOT(onbtnclicked_Setting()));
    connect(ui->Edit, SIGNAL(clicked()), this, SLOT(onbtnclicked_Edit()));
    connect(ui->Pause, SIGNAL(clicked()), this, SLOT(onbtnclicked_Pause()));
    connect(ui->Run, SIGNAL(clicked()), this, SLOT(onbtnclicked_Run()));
    connect(ui->Stop, SIGNAL(clicked()), this, SLOT(onbtnclicked_Stop()));

    connect(ui->fn1, SIGNAL(clicked()), this, SLOT(onbtnclicked_fn1()));
    connect(ui->fn2, SIGNAL(clicked()), this, SLOT(onbtnclicked_fn2()));
    connect(ui->fn3, SIGNAL(clicked()), this, SLOT(onbtnclicked_fn3()));
    connect(ui->fn4, SIGNAL(clicked()), this, SLOT(onbtnclicked_fn4()));

    connect(ui->fn1, SIGNAL(pressed()), this, SLOT(onbtnpressed_fn1()));
    connect(ui->fn2, SIGNAL(pressed()), this, SLOT(onbtnpressed_fn2()));
    connect(ui->fn3, SIGNAL(pressed()), this, SLOT(onbtnpressed_fn3()));
    connect(ui->fn4, SIGNAL(pressed()), this, SLOT(onbtnpressed_fn4()));

    connect(ui->fn1, SIGNAL(released()), this, SLOT(onbtnreleased_fn1()));
    connect(ui->fn2, SIGNAL(released()), this, SLOT(onbtnreleased_fn2()));
    connect(ui->fn3, SIGNAL(released()), this, SLOT(onbtnreleased_fn3()));
    connect(ui->fn4, SIGNAL(released()), this, SLOT(onbtnreleased_fn4()));


    connect(ui->MainScriptStatus, SIGNAL(clicked()), this, SLOT(onbtnclicked_MainScriptStatus()));
    connect(ui->SubScriptStatus, SIGNAL(clicked()), this, SLOT(onbtnclicked_SubScriptStatus()));
    connect(ui->VisHmi, SIGNAL(clicked()), this, SLOT(onbtnclicked_VisHmi()));

    connect(ui->Coordinate, SIGNAL(clicked()), this, SLOT(onbtnclicked_Coordinate()));

    connect(ui->MessageDone, SIGNAL(clicked()), this, SLOT(onbtnclicked_MessageDone()));
    connect(ui->MessageAllDone, SIGNAL(clicked()), this, SLOT(onbtnclicked_MessageAllDone()));
    connect(ui->MessageDetail, SIGNAL(clicked()), this, SLOT(onbtnclicked_MessageDetail()));

    connect(ui->XP, SIGNAL(pressed()), this, SLOT(onbtnpressed_XP()));
    connect(ui->YP, SIGNAL(pressed()), this, SLOT(onbtnpressed_YP()));
    connect(ui->ZP, SIGNAL(pressed()), this, SLOT(onbtnpressed_ZP()));
    connect(ui->AP, SIGNAL(pressed()), this, SLOT(onbtnpressed_AP()));
    connect(ui->BP, SIGNAL(pressed()), this, SLOT(onbtnpressed_BP()));
    connect(ui->CP, SIGNAL(pressed()), this, SLOT(onbtnpressed_CP()));
    connect(ui->XN, SIGNAL(pressed()), this, SLOT(onbtnpressed_XN()));
    connect(ui->YN, SIGNAL(pressed()), this, SLOT(onbtnpressed_YN()));
    connect(ui->ZN, SIGNAL(pressed()), this, SLOT(onbtnpressed_ZN()));
    connect(ui->AN, SIGNAL(pressed()), this, SLOT(onbtnpressed_AN()));
    connect(ui->BN, SIGNAL(pressed()), this, SLOT(onbtnpressed_BN()));
    connect(ui->CN, SIGNAL(pressed()), this, SLOT(onbtnpressed_CN()));

    connect(ui->E1P, SIGNAL(pressed()), this, SLOT(onbtnpressed_E1P()));
    connect(ui->E2P, SIGNAL(pressed()), this, SLOT(onbtnpressed_E2P()));
    connect(ui->E1N, SIGNAL(pressed()), this, SLOT(onbtnpressed_E1N()));
    connect(ui->E2N, SIGNAL(pressed()), this, SLOT(onbtnpressed_E2N()));

    connect(ui->XP, SIGNAL(released()), this, SLOT(onbtnreleased_XP()));
    connect(ui->YP, SIGNAL(released()), this, SLOT(onbtnreleased_YP()));
    connect(ui->ZP, SIGNAL(released()), this, SLOT(onbtnreleased_ZP()));
    connect(ui->AP, SIGNAL(released()), this, SLOT(onbtnreleased_AP()));
    connect(ui->BP, SIGNAL(released()), this, SLOT(onbtnreleased_BP()));
    connect(ui->CP, SIGNAL(released()), this, SLOT(onbtnreleased_CP()));
    connect(ui->XN, SIGNAL(released()), this, SLOT(onbtnreleased_XN()));
    connect(ui->YN, SIGNAL(released()), this, SLOT(onbtnreleased_YN()));
    connect(ui->ZN, SIGNAL(released()), this, SLOT(onbtnreleased_ZN()));
    connect(ui->AN, SIGNAL(released()), this, SLOT(onbtnreleased_AN()));
    connect(ui->BN, SIGNAL(released()), this, SLOT(onbtnreleased_BN()));
    connect(ui->CN, SIGNAL(released()), this, SLOT(onbtnreleased_CN()));

    connect(ui->E1P, SIGNAL(released()), this, SLOT(onbtnreleased_E1P()));
    connect(ui->E2P, SIGNAL(released()), this, SLOT(onbtnreleased_E2P()));
    connect(ui->E1N, SIGNAL(released()), this, SLOT(onbtnreleased_E1N()));
    connect(ui->E2N, SIGNAL(released()), this, SLOT(onbtnreleased_E2N()));

    connect(ui->MannualOverrideP, SIGNAL(clicked()), this, SLOT(onbtnclicked_MannualOverrideP()));
    connect(ui->ProgramOverrideP, SIGNAL(clicked()), this, SLOT(onbtnclicked_ProgramOverrideP()));
    connect(ui->MannualOverrideN, SIGNAL(clicked()), this, SLOT(onbtnclicked_MannualOverrideN()));
    connect(ui->ProgramOverrideN, SIGNAL(clicked()), this, SLOT(onbtnclicked_ProgramOverrideN()));

    return 1;
}
